"""
@Time : 2022/8/31 16:55 
@Author : ls
@DES: 
"""
import functools
from datetime import datetime


def time_counter(origin):
    @functools.wraps(origin)
    def inner(*args, **kwargs):
        start_time = datetime.now()
        res = origin(*args, **kwargs)
        end_time = datetime.now()
        run_time = (end_time - start_time).seconds
        print(f'{inner.__name__}  程序耗时 === {run_time} 秒')
        return res

    return inner
